<template>
    <el-submenu v-if="menu.children && menu.children.length>=1" :index="menu.id">
        <template slot="title">
            <i class="el-icon-location"></i>
            <span>{{menu.name}}</span>
        </template>
        <child v-for="x in menu.children" :menu="x" :key="x.index"></child>
    </el-submenu>
    <el-menu-item v-else :index="menu.id"><span slot="title">{{menu.name}}</span></el-menu-item>

</template>

<script>
    export default {
        name: "child",
        props: ['menu']
    }
</script>

<style scoped>

</style>